<template>
    <el-dialog :close-on-click-modal="false"
               title="跟踪列表"
			   width="1200px"
			   :visible.sync="visible">
        <table-grid
            style="height: 100%"
            :tableColumn="tableColumn"
            :tableData="tableData"
        ></table-grid>
	</el-dialog>
</template>

<script>
export default {
	data () {
		return {
			visible: false,
			tableColumn: [
				{type: 'seq', width: 60},
				{field: 'traceDesc', title: '商机描述'},
				{field: 'biz1', title: '跟踪人'},
				{field: 'traceTime', title: '跟踪时间', width: 150,},
				{field: 'traceDesc', title: '跟踪描述'},
				{field: 'traceStauts', title: '跟踪状态'},
				{field: 'relConnectTel', title: '联系电话'},
				{field: 'cusFeedback', title: '客户反馈意见'},
			],
			tableData: [],
			busiOppoId: ''
		}
	},
	mounted () {

	},
	methods: {
		init(id){
			this.busiOppoId = id;
			this.visible = true;
			this.$http({
				url: this.$http.adornUrl('/crm/oppo/trace/page'),
				method: 'get',
				params: this.$http.adornParams(
					Object.assign(
						{
							current: 1,
							size: 100
						},
						{
							busiOppoId: this.busiOppoId
						}
					)
				)
			}).then(({data}) => {
				this.tableData = data.obj.records
				this.tableData.forEach((item) => {
					item.traceStauts = item.traceStauts === '1' ? '进行中' : '已经结束'
				})
			})
		}
	}
}
</script>

<style lang="scss" scoped>

</style>
